package com.onpositive.utils;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;

import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;

public class DataLocationProvider {
	
	public static File getDataLocation( String subPathStr )
	{
		try{
			URL url = Platform.getInstanceLocation().getDataArea( subPathStr );				
			URL fileURL = FileLocator.toFileURL(url);				
			return new File(fileURL.toURI());
		} catch (IOException e) {
			e.printStackTrace();
		} catch (URISyntaxException e) {
			e.printStackTrace();
		}
		return null ;
	}

}
